﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CPRDataList.aspx.cs" MasterPageFile="~/MasterPage.master"
    Inherits="InStoreDataMeasures_CPRDataList" %>

<%@ Register Src="~/UserControl/GridPager.ascx" TagName="GridPager" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <title>CPR信息查看</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <script type="text/javascript">


        function formatDate(v) {
            if (v instanceof Date) {
                var y = v.getFullYear();
                var m = v.getMonth() + 1;
                var d = v.getDate();
                var h = v.getHours();
                var i = v.getMinutes();
                var s = v.getSeconds();
                var ms = v.getMilliseconds();
                var format = '';
                if (ms > 0)
                    format = y + '-' + m + '-' + d + ' ' + h + ':' + i + ':' + s
						+ '.' + ms;
                if (h > 0 || i > 0 || s > 0)
                    format = y + '-' + m + '-' + d + ' ' + h + ':' + i + ':' + s;

                if (format == '') {
                    if (m < 10 && d < 10)
                        format = y + '-0' + m + '-0' + d;
                    else if (m < 10)
                        format = y + '-0' + m + '-' + d;
                    else if (d < 10)
                        format = y + '-0' + m + '-0' + d;
                    else
                        format = y + '-' + m + '-' + d;
                }

                return format;
            }
            return '';
        }

        $(function () {
            $('#<%=txt_datestart.ClientID %>').datebox({
                currentText: '今天',
                closeText: '关闭',
                disabled: false,
                required: true,
                missingMessage: '必填',
                formatter: formatDate
            });
        });
        $(function () {
            $('#<%=txt_dateend.ClientID %>').datebox({
                currentText: '今天',
                closeText: '关闭',
                disabled: false,
                required: true,
                missingMessage: '必填',
                formatter: formatDate
            });
        });

       
       
       

    </script>
    <div>
        <table id="wsd_inputtable">
            <tr>
                <td class="tabletitle" colspan="6">
                    <asp:Literal ID="Literal4" runat="server" Text="<%$resources:language,lbl_Query_Condition %>"></asp:Literal>
                </td>
            </tr>
            <tr>
                <td class="tablefield">
                    部门
                </td>
                <td nowrap="nowrap" style="width: 20%;">
                    <asp:TextBox ID="txtOrg" runat="server" Width="150px" onkeydown="alert('请选择部门');return false;"
                        Height="21px" class="default"></asp:TextBox>
                    <img src="../Resources/Images/search.png" alt="查找" style="cursor: pointer;" onclick="openPopup('../System/PopupOrganization.aspx?NameControlId=<%# txtOrg.UniqueID %>&ValueControlId=<%# txtHidOrg.UniqueID %>&ChainsControlID=<%# txtHidChains.UniqueID %>&SelectType=multi','','300','500');" /></td>
                <td class="tablefield">
                    &nbsp;门店：
                </td>
                <td class="nowrap">
                    <asp:DropDownList runat="server" ID="drpCustomer" Width="130">
                    </asp:DropDownList>
                </td>
                <td class="tablefield">
                    日期
                </td>
                <td class="nowrap">
                    <asp:TextBox ID="txt_datestart" runat="server"></asp:TextBox>
                    至<asp:TextBox ID="txt_dateend" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="tablefield">
                    &nbsp;
                </td>
                <td class="nowrap">
                    &nbsp;
                </td>
                <td class="tablefield">
                    &nbsp;
                </td>
                <td colspan="2">
                </td>
                <td style="float:right">
                    <asp:Button ID="btnQuery" runat="server" class="wsd_button2" Text="<%$resources:language,btn_Query %>"
                        OnClick="btnQuery_Click" />
                    <input id="Button1" type="button" class="wsd_button2" runat="server" size="47" value="<%$resources:language,btn_Reset %>"
                        name="reset" onclick="clearForm('form1')" /><asp:Button ID="btnExport" runat="server"
                            class="wsd_button2" OnClick="btnExport_Click" Text="导出Excel" />
                </td>
            </tr>
        </table>
        <br />
        <input id="txtHidOrg" type="hidden" runat="server" />
        <input id="txtHidChains" type="hidden" runat="server" />
        <table id="wsd_inputtable">
            <tr>
                <td class="tabletitle">
                    <asp:Literal ID="Literal11" runat="server" Text="采集数据列表"></asp:Literal>
                </td>
            </tr>
        </table>
        <table id="wsd_listtable" width="100%">
            <tr>
                <td style="width: 100%">
                <asp:UpdatePanel runat="server" ID="UpdatePanel1" UpdateMode="Conditional">
                <ContentTemplate>
                    <asp:Panel ID="panelx" runat="server">
                        <asp:GridView BorderWidth="0px" Width="100%" ID="gvChannelType" runat="server" AutoGenerateColumns="False"
                            EmptyDataText="<%$ resources:language,lbl_Empty %>" EmptyDataRowStyle-Font-Bold="true"
                            EmptyDataRowStyle-HorizontalAlign="Center" EnableEmptyContentRender="true" AllowPaging="True"
                            OnRowDataBound="gvChannelType_RowDataBound" OnPageIndexChanging="PageIndexChanged">
                            <HeaderStyle CssClass="titlist" />
                            <EmptyDataRowStyle HorizontalAlign="Center" Font-Bold="True"></EmptyDataRowStyle>
                            <Columns>
                                <asp:BoundField DataField="CCODE" HeaderText="门店编号" />
                                <asp:BoundField DataField="CNAME" HeaderText="门店" />
                                <asp:BoundField DataField="PCODE" HeaderText="产品编号" />
                                <asp:BoundField DataField="PRODUCTNAME" HeaderText="产品名称" />
                                <asp:BoundField DataField="THVALUE" HeaderText="退货" />
                                <asp:BoundField DataField="STORAGE" HeaderText="库存" />
                                <asp:BoundField DataField="SALE" HeaderText="销量" />
                                <asp:BoundField DataField="ORDER_COUNT" HeaderText="订单" />
                                <asp:BoundField DataField="DATE" HeaderText="日期" />
                            </Columns>
                            <RowStyle CssClass="evenline" />
                            <AlternatingRowStyle CssClass="oddline" />
                            <PagerSettings Visible="false" />
                        </asp:GridView>
                    </asp:Panel>
                    <uc1:GridPager ID="GridPager1" runat="server" Visible="false" />
                    </ContentTemplate>
                    <Triggers>
                    
                        <asp:AsyncPostBackTrigger ControlID="btnQuery" EventName="Click" />
                    
                    </Triggers>
                    </asp:UpdatePanel>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
